UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '20w7X0XQPx3YA36dwdOKV8VvjTnW6KUTLRj2Lpw8gcM=' 
WHERE 
  key_id = 'ad0f3294777dc49b82fb85b010bc6e73fb84313b5f952039db7d6378e5159f16' 
  AND (
    token = '20w7X0XQPx3YA36dwdOKV8VvjTnW6KUTLRj2Lpw8gcM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00017