UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'QQld9s4fNXp7z00DQhs7QJ+lG0cUzlDS8obUP9eVSfA=' 
WHERE 
  key_id = 'd7314df53a1d2fd1f255c76c87e1382bbfc606f68f6aba325f828bebe4fb7cdc' 
  AND (
    token = 'QQld9s4fNXp7z00DQhs7QJ+lG0cUzlDS8obUP9eVSfA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038