UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '8ZIrplOBPEKQQ6/Epx4gBD2bpGGyIyh0V6H9Y4zjJL4=' 
WHERE 
  key_id = '8d1e828c018beedff7b59466fd64c3efdc7830dfe45905bc2489ccb6b30037de' 
  AND (
    token = '8ZIrplOBPEKQQ6/Epx4gBD2bpGGyIyh0V6H9Y4zjJL4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034