UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '4uD/7tcmO/PNJ3a36ySqXMmGLYUsJmwpFKCQy+sECTQ=' 
WHERE 
  key_id = '1864bb5f674421d3b6128ae2f9e59ec2f4b82e1530954e4b02ef3336b1c9cf03' 
  AND (
    token = '4uD/7tcmO/PNJ3a36ySqXMmGLYUsJmwpFKCQy+sECTQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039