UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ktS+51lt/vFvw+64GVkKA3l7k+OWdpU5zF5ZNXzHl/E='
WHERE
key_id = '9c35b36e1a5cd3aaa653e0653fabd54e9bafa9b44df7af9b428777be1a424142'
AND (
token = 'ktS+51lt/vFvw+64GVkKA3l7k+OWdpU5zF5ZNXzHl/E='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)