UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'GLZZ/oyZVahErZUzwDMVOeppaDCylhvfDFH55TY6Mns=' 
WHERE 
  key_id = '935aa431966295b3b81144276e6ff9eb68611f4ac585cda8127cb1ae4433633e' 
  AND (
    token = 'GLZZ/oyZVahErZUzwDMVOeppaDCylhvfDFH55TY6Mns=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034