UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'RLxAhuLVSPXlnVkHdtk27kPYSZSwQZd7HiAUpbVSBnQ=' 
WHERE 
  key_id = '9c2cca2f6b4c63be674ec7c63ac36ea1b2c107346c394a631d8434613ebe52dd' 
  AND (
    token = 'RLxAhuLVSPXlnVkHdtk27kPYSZSwQZd7HiAUpbVSBnQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031