UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '1+GRLES9ptX8WoL3KT3R1qsM9CWQIlwUA9xB2ATR5NI=' 
WHERE 
  key_id = '48e278989ee9f0d7f72a04ba0083691b67808f6fe7db33ab2396f1f4e73db955' 
  AND (
    token = '1+GRLES9ptX8WoL3KT3R1qsM9CWQIlwUA9xB2ATR5NI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00042