UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'fOOlCOiUVegn5tU5zWpyrvB9VeJsYB3Khwl8xDYNLM8='
WHERE
key_id = '2f744889f2c7c93bf2450736501f2d70d4ef8d7f270ac5bd95c1a62148624a84'
AND (
token = 'fOOlCOiUVegn5tU5zWpyrvB9VeJsYB3Khwl8xDYNLM8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)