UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '15CwJKvvzArsUROVHBEEqe2sBwsBcdKYlwQy1s5MF5I='
WHERE
key_id = '3fa3fa5ef74bd60884bf0633563a241efab60c99544e7ff54616430118c2bb27'
AND (
token = '15CwJKvvzArsUROVHBEEqe2sBwsBcdKYlwQy1s5MF5I='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)