UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'U+vpu6bZiSgICH/YvjIRUGlvPfGbfkA50BCrGk5hGio=' 
WHERE 
  key_id = 'd879e58223ec8ff9112d83b4a0316c5af9c35e3e35a7e1750b8638ff42e1932c' 
  AND (
    token = 'U+vpu6bZiSgICH/YvjIRUGlvPfGbfkA50BCrGk5hGio=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029