UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'mPEHqu06jc19rEPGJEhOxXbm7Osaz3ZTEwW9tTBgon8=' 
WHERE 
  key_id = '33e1ac2ab8fd073734fd777653a3afa1e7fe4990017078642989c91f000eb356' 
  AND (
    token = 'mPEHqu06jc19rEPGJEhOxXbm7Osaz3ZTEwW9tTBgon8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030