UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'cy6wMc7C5e2MqMdjpbhn9vpUTXA1NJI+9LqQ1WLcD+U=' 
WHERE 
  key_id = '0bf0d6edf0ae34fd25a5ae7f536aeec2b64784a8191a9f783ada18545cb402a0' 
  AND (
    token = 'cy6wMc7C5e2MqMdjpbhn9vpUTXA1NJI+9LqQ1WLcD+U=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031