UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'f1L+ctCpryqhFCOzzUjjyVBK4aJg+soCDWvlFOWlAtY=' 
WHERE 
  key_id = '7ac94a959646a719a8d27bcb59ab9f92eb7ef384cf7a2dfe043899a2f73f853a' 
  AND (
    token = 'f1L+ctCpryqhFCOzzUjjyVBK4aJg+soCDWvlFOWlAtY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028