UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '+8WtJPcYlNHHYte+3W+uHhEuD55bYnYrY6omy4tYAjc='
WHERE
key_id = '6281bcf11e462ad863bcc512d1e3fbd8cdafba0041f70579bdb5398db9d829a0'
AND (
token = '+8WtJPcYlNHHYte+3W+uHhEuD55bYnYrY6omy4tYAjc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)