UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'lI1L6KX+CdXZMSwcMP5XKtIwO49FCB25uOqRKCgv8aI='
WHERE
key_id = '25e8a18ba651a72156eed4ae7f828e6f46c5d071dc76f172c7db72852add5896'
AND (
token = 'lI1L6KX+CdXZMSwcMP5XKtIwO49FCB25uOqRKCgv8aI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)