UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'LUry72bZN1JqPn4Oh7NohqqV6CYHRh/6BBb/wmdx5OQ='
WHERE
key_id = 'b1f4014bcb70c70fb71852f10012ef6a93cf9e39eee7b53eb481a64c3f6d7b79'
AND (
token = 'LUry72bZN1JqPn4Oh7NohqqV6CYHRh/6BBb/wmdx5OQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)