UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'silAxlJOMIRD8UIEcBmR0Wv3KLRVPj7bRg+mCyV25xk='
WHERE
key_id = '40a109fc231ea700695301479e3e8d10a81287f842c4c2fde5cb5a73ecf7ca6a'
AND (
token = 'silAxlJOMIRD8UIEcBmR0Wv3KLRVPj7bRg+mCyV25xk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)