UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'I2pKNq5Q/esEq8IDg5TKYGPxz6KknEMVx0866wZUYJM=' 
WHERE 
  key_id = '1fabaace5ca4b05e2ed1a279ba858c7d21a8038e0f3f5ab335e967e87c027132' 
  AND (
    token = 'I2pKNq5Q/esEq8IDg5TKYGPxz6KknEMVx0866wZUYJM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029