UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'TtqNx6iLu6b/ymYtx+rTnkqFV3Jx3VpqWmvzagOx/Hk='
WHERE
key_id = '2cd1a16a8c51253614e4f6a8078e4bf24ea5a26b5fcf3d3372ce99d13b9d4ed6'
AND (
token = 'TtqNx6iLu6b/ymYtx+rTnkqFV3Jx3VpqWmvzagOx/Hk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)