UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'wPnFmKTikwkkGvvBTOkz6Npf+KlVvLQ+EqfDjKwGjsg='
WHERE
key_id = 'a054a04b2cc37c02cba8d87f62173abf793666cfbb0bca7ed9eb1c5d45a967a4'
AND (
token = 'wPnFmKTikwkkGvvBTOkz6Npf+KlVvLQ+EqfDjKwGjsg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)