UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Z8c3W+n683c9oL9l9i75dH+EI8ecNcwkCZ83ezKD7O8=' 
WHERE 
  key_id = '808608f611db755c22f1f6575ed6514b96814b8ae14afbc8d6cdb3c831530f1b' 
  AND (
    token = 'Z8c3W+n683c9oL9l9i75dH+EI8ecNcwkCZ83ezKD7O8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00016