UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'kSSeBwE7v34qmoxD+ZeIQeyaFrdEJ8Dg2LiF8wHB2C4=' 
WHERE 
  key_id = '152284176d77a8b236c74ce615433830676464c88e29e3698967b2aba6678b6c' 
  AND (
    token = 'kSSeBwE7v34qmoxD+ZeIQeyaFrdEJ8Dg2LiF8wHB2C4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037