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

Query time 0.00039