UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'qNkaQIZ1iF8whoPx37beN5DYIGFMLBfxwp3lgsl1mbQ='
WHERE
key_id = '0c1950fc8a3c88a375add17cd276b71a31826810b22d35f44a0170b799ba96e7'
AND (
token = 'qNkaQIZ1iF8whoPx37beN5DYIGFMLBfxwp3lgsl1mbQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)