UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'SMUMPi2xe1vL2O4pR8X3hTu0hVMJU8oM21MwISUvvtc='
WHERE
key_id = '21ded29f298db5080ed9483ff1fbdd360fa63bd75f413f05f419d7c77314c54d'
AND (
token = 'SMUMPi2xe1vL2O4pR8X3hTu0hVMJU8oM21MwISUvvtc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)