UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'p4f9unHQbuwpgDfhpOzFC0ZB5vwZka8cvi8vjS4eVTs=' 
WHERE 
  key_id = '58465c84ce97d00e83fe89c0d1ddb98d16c022004ab42d3d9ae7b0186ad7e360' 
  AND (
    token = 'p4f9unHQbuwpgDfhpOzFC0ZB5vwZka8cvi8vjS4eVTs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026