UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'eKIQJrgrB6ZIQCwdI3zn/SFt8dkToEUSNsgorq7sgig=' 
WHERE 
  key_id = '5535a03888089837b9a8fbf9fcd0cc5fce7498ac02291aadf9e70244fc5b4151' 
  AND (
    token = 'eKIQJrgrB6ZIQCwdI3zn/SFt8dkToEUSNsgorq7sgig=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00023