UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'cCdM3o1PGPxLPLnkJ6Cqrjs7bcvCE/Z+C5PN6M6UtPQ=' 
WHERE 
  key_id = 'a45bfa00d78a8b0665ed418a21e6f7c541a75bef9c12e3d54d9525b21351ad2f' 
  AND (
    token = 'cCdM3o1PGPxLPLnkJ6Cqrjs7bcvCE/Z+C5PN6M6UtPQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022