UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '44RDCeAW+zyEUDSuqvmB3THov72u2zLyXg9WCQi+a5k='
WHERE
key_id = 'e25a664d0af1363d7bacdd6c919ebe083362fe7aab27751036c975cd9ba8ff79'
AND (
token = '44RDCeAW+zyEUDSuqvmB3THov72u2zLyXg9WCQi+a5k='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)