UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'm7fjhabJsmxTe2MD4fVr2LwPgSkqUiffBg09w0DZO3M='
WHERE
key_id = 'b7536dd524306c104547f57c2338a48a33c0da1a6d56f063221b1b83b41e5b15'
AND (
token = 'm7fjhabJsmxTe2MD4fVr2LwPgSkqUiffBg09w0DZO3M='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)