UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'OE2dvB0bKbkRHgL76gfdhXD9YrzkPO40Zwcm0lt9IgE=' 
WHERE 
  key_id = '91f05a1ec96cdf50e97011eb13a2486a902ce48fe8bd0b6479db34d193b738dd' 
  AND (
    token = 'OE2dvB0bKbkRHgL76gfdhXD9YrzkPO40Zwcm0lt9IgE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032