UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '8p1efoc4FN220QgnRD+Y/lWf2iEBpjPqPHqM8FB1Jmw='
WHERE
key_id = '887a4e159e6a2c712522768244ec60d4c9d5c05007fc522dc28db45c4e4fc0fc'
AND (
token = '8p1efoc4FN220QgnRD+Y/lWf2iEBpjPqPHqM8FB1Jmw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)