UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '8RHMeoKL7pGkctHhYchTgao0K+YuW31PfjfZFKpNKZA='
WHERE
key_id = 'c7cbcb4f818cbbd00a4458db97f8201f185bb780bc3c27f3f4e8c8b9b627ea26'
AND (
token = '8RHMeoKL7pGkctHhYchTgao0K+YuW31PfjfZFKpNKZA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)