UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'w2FKuyHRjdauIhSW/Qa1ppk8nyA/ZjVKkcBhyjY+hBw=' 
WHERE 
  key_id = 'beeb3070bf5a3aa0b41adb3ef5d904d15c53866fa6afbe2312173db92c31b745' 
  AND (
    token = 'w2FKuyHRjdauIhSW/Qa1ppk8nyA/ZjVKkcBhyjY+hBw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00019