UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'p92D8i6HiOGBqKYCv1QSPMq8vofyed9y7RVfdEpN5eo=' 
WHERE 
  key_id = 'dd7e9048470ed339225b425b7c82692100d925f5357cc573ae94c95236c03672' 
  AND (
    token = 'p92D8i6HiOGBqKYCv1QSPMq8vofyed9y7RVfdEpN5eo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00043