UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'xkdVdtsmUEOpukWewz6ZCPGFJ66qkVI4xYHYJXLca5A='
WHERE
key_id = 'fd983f265f11c9ad06bd99be0aea851085e51aaa2189ff83fb721b7d284b6749'
AND (
token = 'xkdVdtsmUEOpukWewz6ZCPGFJ66qkVI4xYHYJXLca5A='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)