UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '2vS9KztAqfG3sUI+AzOEhSqvo6rG8TkdRkgn6hRk3eA='
WHERE
key_id = '722b6f5e2765ecd9a837f3cee6401a1dc936763f5629d25136c10d90c3bd93df'
AND (
token = '2vS9KztAqfG3sUI+AzOEhSqvo6rG8TkdRkgn6hRk3eA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)