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

Query time 0.00030