UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'hguC49eu7jtBezf8hKKFoYHYGdVTZKMyfg+Ibsv8Xj8=' 
WHERE 
  key_id = '32ed40f249b04edee214cdbfa89622a9cb9edb897b4ed224fa4150e00f3e0638' 
  AND (
    token = 'hguC49eu7jtBezf8hKKFoYHYGdVTZKMyfg+Ibsv8Xj8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031