UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'H3ws7YtUwN5upuI4MYqXbnzJXVrSgSzDXfmcIj4e9gk='
WHERE
key_id = '06190a96b7edc3d0a4a409f3fc29b091b9c8e29f1545308d5fbad92cea8d47c3'
AND (
token = 'H3ws7YtUwN5upuI4MYqXbnzJXVrSgSzDXfmcIj4e9gk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)