UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'RuRoUXZiJPk1MamgDxEOPILMz/MdCgLimSNGckTs31g='
WHERE
key_id = 'dc131a70b89c363c63f8aba857cd9011486ee6196b23520e7b140b01c456b5a8'
AND (
token = 'RuRoUXZiJPk1MamgDxEOPILMz/MdCgLimSNGckTs31g='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)