UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'xhaW+63SGeygdLm9XpUBpiQp0MXAR82MdMlKsOisXH8=' 
WHERE 
  key_id = '00992a97eefea75ac01dff1d11a3103593d58286949dfa0374709fc82411c1ab' 
  AND (
    token = 'xhaW+63SGeygdLm9XpUBpiQp0MXAR82MdMlKsOisXH8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00018