UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'AIxtIoboexI75ms8JvYfhsoDuCCT2k9BE00iVjS6mMM='
WHERE
key_id = '6a5ea83f6271e8a52608d4b155d2e1917d97a4ec1b16581a330cdeedf19e391f'
AND (
token = 'AIxtIoboexI75ms8JvYfhsoDuCCT2k9BE00iVjS6mMM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)