UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '7758sSBS5kQ8lzCcuxsKAN2BrrpIA8H6kb8Wvbw9IOE='
WHERE
key_id = '80afdc41771feaad9bfdbd7b62be19104029f8b334a8caa28ee6c1fcf9998abb'
AND (
token = '7758sSBS5kQ8lzCcuxsKAN2BrrpIA8H6kb8Wvbw9IOE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)