UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'xLVuO+v2mI3B7GcABKXcbtJPMzYZgUt3QFbCPzf3MMY='
WHERE
key_id = '3d86fb83e639b803b41edff47c674d20b7838e3660ea1178116703a3a0a26fbd'
AND (
token = 'xLVuO+v2mI3B7GcABKXcbtJPMzYZgUt3QFbCPzf3MMY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)