UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Swx/qnsvBBDexlDdgMh0ZXiaHEqv2Xd5nFAuzKXhK78='
WHERE
key_id = 'd4d91b02dc31ff7597646f50f457d4070ae66293e3d6aec6dcb5ff9b9dcae000'
AND (
token = 'Swx/qnsvBBDexlDdgMh0ZXiaHEqv2Xd5nFAuzKXhK78='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)