UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'voUysBhv6cpuw637T0HIKnO8Qg6i0Q//1hkIfK/7rDk=' 
WHERE 
  key_id = 'fc419161338ca4ccddc4731b812d4e18ddd3b39b18a6f1e5cdf26d180ed95521' 
  AND (
    token = 'voUysBhv6cpuw637T0HIKnO8Qg6i0Q//1hkIfK/7rDk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00049