UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '7mZYuh+6ymQlOz5sFR5OzF3uqfozvHAn8ekCLkrZvB0='
WHERE
key_id = 'ab271912fb3695fa7ce4c609b54ca50a0dca744b636fad5829164584522698b3'
AND (
token = '7mZYuh+6ymQlOz5sFR5OzF3uqfozvHAn8ekCLkrZvB0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)