UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '5wQLxLezKTz+6SPRa9ZrFl6xGI8TnhkXh5CPktuaizQ='
WHERE
key_id = 'ec7bcecfb7e208be548377b1ad861d43f80e4519d2824b1e87ba21e3bcbe782b'
AND (
token = '5wQLxLezKTz+6SPRa9ZrFl6xGI8TnhkXh5CPktuaizQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)