UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'sBc6VTGEqb6QGLjoA+BCaiYkK+JQKk3oNcsPZGP5mIg=' 
WHERE 
  key_id = '8a0b627cdcc30b306872cf5f82df1451f9ae336ec6de26ef835ead09a5be0b35' 
  AND (
    token = 'sBc6VTGEqb6QGLjoA+BCaiYkK+JQKk3oNcsPZGP5mIg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028