UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'WmsBjBd8MO1slcR7k+Kr7LDsGIdOKUJoPQpXw8K8v2Q='
WHERE
key_id = '9bf8d955cf50b3e9a3a9c32f5958ca2abeaf778e60cfa385ea072d6837fde9c2'
AND (
token = 'WmsBjBd8MO1slcR7k+Kr7LDsGIdOKUJoPQpXw8K8v2Q='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)