UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'zTjB9wRj/s0j+kQRhcCsZtOaDE6Cf5X/06xnN25NOYQ=' 
WHERE 
  key_id = '4c4e2bcb622785c3b241394c07d29babe9bebbef761841f61ed59da8ed0e61b8' 
  AND (
    token = 'zTjB9wRj/s0j+kQRhcCsZtOaDE6Cf5X/06xnN25NOYQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031