UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '2Y0KavVmgh8kyPlR9Tb7ZEwZaC3fK56+V61C+GvYuic='
WHERE
key_id = '6b15e88ee94f6de70b355c1fee9ed5c05df69757f0163af4d4dd23f34ba4a54b'
AND (
token = '2Y0KavVmgh8kyPlR9Tb7ZEwZaC3fK56+V61C+GvYuic='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)