UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'OFqN7P/Y5UUAbDhft37fXdRQkJLGUc885lLvARkgeyw='
WHERE
key_id = '4dc672fc0a1ddf43a27c97aab74b1f659bb854904707d812b01844df55de349a'
AND (
token = 'OFqN7P/Y5UUAbDhft37fXdRQkJLGUc885lLvARkgeyw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)