UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ym3XTqs5b+EXo4gC5XzLwfCsPOj9dwYjk9RgQpvoXVw=' 
WHERE 
  key_id = '6ac3dddb26d06625cc0f71fa58a2fb4245b5a62d9bc235caf1ce7d20387e5d9b' 
  AND (
    token = 'ym3XTqs5b+EXo4gC5XzLwfCsPOj9dwYjk9RgQpvoXVw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00016