UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'pLrLbLsXiPy2BkrJVvcIn0X1gz4oNG6jj7EpU6IEKuI='
WHERE
key_id = '8167c091a31ccdf9a2c251aa443a4650500e335e7a81f9b0f8ada5532686b8ff'
AND (
token = 'pLrLbLsXiPy2BkrJVvcIn0X1gz4oNG6jj7EpU6IEKuI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)