UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'LYMDOmDPB+MkKr4TH81GpR6WreKRqVmuRCTJ0dLcxIg=' 
WHERE 
  key_id = '94b550f92c5279781f2091fa490da7fa6fbca90ed9e67697978abc74931d55c5' 
  AND (
    token = 'LYMDOmDPB+MkKr4TH81GpR6WreKRqVmuRCTJ0dLcxIg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00055