UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'L9gSEzYN0y1TgAipF6B9wRiSEXy7y9c9Pu52LvvdILs='
WHERE
key_id = '9cff3d05a4eca2a2eb12ad3d30dbe0d87ab40f3b5073f61fe71f2f5c227326e1'
AND (
token = 'L9gSEzYN0y1TgAipF6B9wRiSEXy7y9c9Pu52LvvdILs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)