UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '4mDWmvccMc8fdqtQfaJ6KblWg2PcaXuMuklADPuUrao=' 
WHERE 
  key_id = '809a5b4ddcf840f2cc7b2bbdc42a2f3d9f397ad09b10d3501bb3ed7ad4f235b1' 
  AND (
    token = '4mDWmvccMc8fdqtQfaJ6KblWg2PcaXuMuklADPuUrao=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028